package com.hzhr.iot.collect.constant;

/**
 * 请求响应标志
 * @author 48310
 *
 */
public enum RequestResponseFlagEnum {
	REQ(10000040, 0),
	RESP(10000051, 1);
	
	private int id;
	private int idForMessage;//报文中的编号
	private RequestResponseFlagEnum(int id, int idForMessage) {
		this.id = id;
		this.idForMessage = idForMessage;
	}
	
	public int getId() {
		return id;
	}
	public int getIdForMessage() {
		return idForMessage;
	}
	
	public static RequestResponseFlagEnum getEnumByIdForMessage(int idForMessage) {
		for (RequestResponseFlagEnum value : RequestResponseFlagEnum.values()) {
			if (value.getIdForMessage() == idForMessage) {
				return value;
			}
		}
		return null;
	}
	
	public static RequestResponseFlagEnum getEnumByEnumName(String EnumName) {
		for (RequestResponseFlagEnum value : RequestResponseFlagEnum.values()) {
			if (value.toString().equals(EnumName)) {
				return value;
			}
		}
		return null;
	} 
}
